using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using DataInfo;
using XBLib.Dal;
using XBLib.Dal.AdoDal;
using XBLib.BusinessObject;
using System.Data.Common;
namespace KenLib.Dal
{
    public class 本社履歴Dao : BaseAdoDao
    {
        public int Ins_Upd本社履歴(本社履歴 info, string strColumnsName)
        {
            List<DbParameter> lsParam = new GlobalDao().CreateArrayParam(info, strColumnsName);
            DbParameter paramID = _daoHelper.CreateParameter("@ID", info.ID, DbType.Int32, ParameterDirection.InputOutput);
            lsParam.Add(paramID);
            DbCommand command = _daoHelper.CreateCommand(CommandNameManager.INS_UPD_本社履歴, CommandType.StoredProcedure, lsParam.ToArray());
            int iExe = _daoHelper.Execute(command);
            return Convert.ToInt32(paramID.Value);
        }
        #region TUNG
        public void Insert本社履歴(本社履歴 en)
        {
            DbParameter dbParam = _daoHelper.CreateParameter("@廃止区分", en.廃止区分, DbType.Int16);
            DbParameter dbParam1 = _daoHelper.CreateParameter("@年度", en.年度, DbType.Int32);
            DbParameter dbParam2 = _daoHelper.CreateParameter("@決算月", en.決算月, DbType.String);
            DbParameter dbParam3 = _daoHelper.CreateParameter("@売上", en.売上, DbType.Decimal);
            DbParameter dbParam4 = _daoHelper.CreateParameter("@営業損益", en.営業損益, DbType.Decimal);
            DbParameter dbParam5 = _daoHelper.CreateParameter("@経営損益", en.経営損益, DbType.Decimal);
            DbParameter dbParam6 = _daoHelper.CreateParameter("@当期損益", en.当期損益, DbType.Decimal);
            DbParameter dbParam7 = _daoHelper.CreateParameter("@常勤事務男", en.常勤事務男, DbType.Int32);
            DbParameter dbParam8 = _daoHelper.CreateParameter("@常勤事務女", en.常勤事務女, DbType.Int32);
            DbParameter dbParam9 = _daoHelper.CreateParameter("@常勤現場男", en.常勤現場男, DbType.Int32);
            DbParameter dbParam10 = _daoHelper.CreateParameter("@常勤現場女", en.常勤現場女, DbType.Int32);
            DbParameter dbParam11 = _daoHelper.CreateParameter("@非常勤事務男", en.非常勤事務男, DbType.Int32);
            DbParameter dbParam12 = _daoHelper.CreateParameter("@非常勤現場女", en.非常勤現場女, DbType.Int32);
            DbParameter dbParam13 = _daoHelper.CreateParameter("@大卒初任給", en.大卒初任給, DbType.Int32);
            DbParameter dbParam14 = _daoHelper.CreateParameter("@高卒初任給", en.高卒初任給, DbType.Int32);
            DbParameter dbParam15 = _daoHelper.CreateParameter("@中卒初任給", en.中卒初任給, DbType.Int32);
            DbParameter dbParam16 = _daoHelper.CreateParameter("@年間労働日数", en.年間労働日数, DbType.Int32);
            DbParameter dbParam17 = _daoHelper.CreateParameter("@勤務開始時間", en.勤務開始時間, DbType.String);
            DbParameter dbParam18 = _daoHelper.CreateParameter("@昼休み開始時間", en.昼休み開始時間, DbType.String);
            DbParameter dbParam19 = _daoHelper.CreateParameter("@昼休み終了時間", en.昼休み終了時間, DbType.String);
            DbParameter dbParam20 = _daoHelper.CreateParameter("@勤務終了時間", en.勤務終了時間, DbType.String);
            DbParameter dbParam21 = _daoHelper.CreateParameter("@休憩時間", en.休憩時間, DbType.Int32);
            DbParameter dbParam22 = _daoHelper.CreateParameter("@所定労働時間", en.所定労働時間, DbType.Int32);
            DbParameter dbParam23 = _daoHelper.CreateParameter("@所定労働時間_分", en.所定労働時間_分, DbType.Int32);
            DbParameter dbParam24 = _daoHelper.CreateParameter("@平均週間労働日数", en.平均週間労働日数, DbType.Int32);
            DbParameter dbParam25 = _daoHelper.CreateParameter("@企業ID", en.企業ID, DbType.Int32);
            DbCommand dbcommand = _daoHelper.CreateCommand("Insert本社履歴_TUNG", CommandType.StoredProcedure, dbParam , dbParam1, dbParam2, dbParam3, dbParam4, dbParam5, dbParam6, dbParam7, dbParam8, dbParam9, dbParam10, dbParam11, dbParam12, dbParam13, dbParam14, dbParam15, dbParam16, dbParam17, dbParam18, dbParam19, dbParam20, dbParam21, dbParam22, dbParam23, dbParam24, dbParam25);
            _daoHelper.Execute(dbcommand);

        }
        public DataTable GetYear本社履歴(int 年度, int 企業ID)
        {
            DbParameter dbParam = _daoHelper.CreateParameter("@年度", 年度, DbType.Int32);
            DbParameter dbParam1 = _daoHelper.CreateParameter("@企業ID", 企業ID, DbType.Int32);
            DbCommand dbcommand = _daoHelper.CreateCommand("sp_GetYear本社履歴_TUNG", CommandType.StoredProcedure, dbParam, dbParam1);
            return _daoHelper.Query(dbcommand);
        }


        public void Update本社履歴(本社履歴 en)
        {
            DbParameter dbParam = _daoHelper.CreateParameter("@廃止区分", en.廃止区分, DbType.Int16);
            DbParameter dbParam1 = _daoHelper.CreateParameter("@年度", en.年度, DbType.Int32);
            DbParameter dbParam2 = _daoHelper.CreateParameter("@決算月", en.決算月, DbType.String);
            DbParameter dbParam3 = _daoHelper.CreateParameter("@売上", en.売上, DbType.Decimal);
            DbParameter dbParam4 = _daoHelper.CreateParameter("@営業損益", en.営業損益, DbType.Decimal);
            DbParameter dbParam5 = _daoHelper.CreateParameter("@経営損益", en.経営損益, DbType.Decimal);
            DbParameter dbParam6 = _daoHelper.CreateParameter("@当期損益", en.当期損益, DbType.Decimal);
            DbParameter dbParam7 = _daoHelper.CreateParameter("@常勤事務男", en.常勤事務男, DbType.Int32);
            DbParameter dbParam8 = _daoHelper.CreateParameter("@常勤事務女", en.常勤事務女, DbType.Int32);
            DbParameter dbParam9 = _daoHelper.CreateParameter("@常勤現場男", en.常勤現場男, DbType.Int32);
            DbParameter dbParam10 = _daoHelper.CreateParameter("@常勤現場女", en.常勤現場女, DbType.Int32);
            DbParameter dbParam11 = _daoHelper.CreateParameter("@非常勤事務男", en.非常勤事務男, DbType.Int32);
            DbParameter dbParam12 = _daoHelper.CreateParameter("@非常勤現場女", en.非常勤現場女, DbType.Int32);
            DbParameter dbParam13 = _daoHelper.CreateParameter("@大卒初任給", en.大卒初任給, DbType.Int32);
            DbParameter dbParam14 = _daoHelper.CreateParameter("@高卒初任給", en.高卒初任給, DbType.Int32);
            DbParameter dbParam15 = _daoHelper.CreateParameter("@中卒初任給", en.中卒初任給, DbType.Int32);
            DbParameter dbParam16 = _daoHelper.CreateParameter("@年間労働日数", en.年間労働日数, DbType.Int32);
            DbParameter dbParam17 = _daoHelper.CreateParameter("@勤務開始時間", en.勤務開始時間, DbType.String);
            DbParameter dbParam18 = _daoHelper.CreateParameter("@昼休み開始時間", en.昼休み開始時間, DbType.String);
            DbParameter dbParam19 = _daoHelper.CreateParameter("@昼休み終了時間", en.昼休み終了時間, DbType.String);
            DbParameter dbParam20 = _daoHelper.CreateParameter("@勤務終了時間", en.勤務終了時間, DbType.String);
            DbParameter dbParam21 = _daoHelper.CreateParameter("@休憩時間", en.休憩時間, DbType.Int32);
            DbParameter dbParam22 = _daoHelper.CreateParameter("@所定労働時間", en.所定労働時間, DbType.Int32);
            DbParameter dbParam23 = _daoHelper.CreateParameter("@所定労働時間_分", en.所定労働時間_分, DbType.Int32);
            DbParameter dbParam24 = _daoHelper.CreateParameter("@平均週間労働日数", en.平均週間労働日数, DbType.Int32);
            DbParameter dbParam25 = _daoHelper.CreateParameter("@企業ID", en.企業ID, DbType.Int32);
            DbCommand dbcommand = _daoHelper.CreateCommand("sp_Update本社履歴_TUNG", CommandType.StoredProcedure, dbParam, dbParam1, dbParam2, dbParam3, dbParam4, dbParam5, dbParam6, dbParam7, dbParam8, dbParam9, dbParam10, dbParam11, dbParam12, dbParam13, dbParam14, dbParam15, dbParam16, dbParam17, dbParam18, dbParam19, dbParam20, dbParam21, dbParam22, dbParam23, dbParam24, dbParam25);
            _daoHelper.Execute(dbcommand);

        }


        #endregion


        #region Vhoat
        public DataTable frmJ_CompHistoryInput_Select本社履歴With企業ID(int 企業ID)
        {
            DbCommand com = _daoHelper.CreateCommand(CommandNameManager.sp_frmJ_CompHistoryInput_Select本社履歴With企業ID_Dong, CommandType.StoredProcedure);
            DbParameter para1 = _daoHelper.CreateParameter("@企業ID", 企業ID, DbType.Int32);
            com.Parameters.Add(para1);
            return _daoHelper.Query(com);
        }

        public int frmJ_CompHistoryInput_Insert(int 年度, string 決算月, decimal 売上, decimal 営業損益, decimal 経営損益, decimal 当期損益, int 常勤事務男, int 常勤事務女, int 常勤現場男, int 常勤現場女, int 非常勤現場女, int 非常勤事務男, int 企業ID)
        {
            DbCommand com = _daoHelper.CreateCommand(CommandNameManager.sp_frmJ_CompHistoryInput_Insert_Dong, CommandType.StoredProcedure);
            DbParameter para1 = _daoHelper.CreateParameter("@年度", 年度, DbType.Int32);
            DbParameter para2 = _daoHelper.CreateParameter("@決算月", 決算月, DbType.String);
            DbParameter para3 = _daoHelper.CreateParameter("@売上", 売上, DbType.Decimal);
            DbParameter para4 = _daoHelper.CreateParameter("@営業損益", 営業損益, DbType.Decimal);
            DbParameter para5 = _daoHelper.CreateParameter("@経営損益", 経営損益, DbType.Decimal);
            DbParameter para6 = _daoHelper.CreateParameter("@当期損益", 当期損益, DbType.Decimal);
            DbParameter para7 = _daoHelper.CreateParameter("@常勤事務男", 常勤事務男, DbType.Int32);
            DbParameter para8 = _daoHelper.CreateParameter("@常勤事務女", 常勤事務女, DbType.Int32);
            DbParameter para9 = _daoHelper.CreateParameter("@常勤現場男", 常勤現場男, DbType.Int32);
            DbParameter para10 = _daoHelper.CreateParameter("@常勤現場女", 常勤現場女, DbType.Int32);
            DbParameter para11 = _daoHelper.CreateParameter("@非常勤現場女", 非常勤現場女, DbType.Int32);
            DbParameter para12 = _daoHelper.CreateParameter("@非常勤事務男", 非常勤事務男, DbType.Int32);
            DbParameter para13 = _daoHelper.CreateParameter("@企業ID", 企業ID, DbType.Int32);
            com.Parameters.Add(para1);
            com.Parameters.Add(para2);
            com.Parameters.Add(para3);
            com.Parameters.Add(para4);
            com.Parameters.Add(para5);
            com.Parameters.Add(para6);
            com.Parameters.Add(para7);
            com.Parameters.Add(para8);
            com.Parameters.Add(para9);
            com.Parameters.Add(para10);
            com.Parameters.Add(para11);
            com.Parameters.Add(para12);
            com.Parameters.Add(para13);
            return _daoHelper.Execute(com);

        }

        public int insert_本社履歴_60_Default_Vh(本社履歴 obj, string id企業ID, string str決算月, out int IdCurrent)
        {
            int i = 0;
            IdCurrent = 0;
            DbCommand com = _daoHelper.CreateCommand(CommandNameManager.insert_本社履歴_60_2_Default_Vh, CommandType.StoredProcedure);
            DbParameter para1 = _daoHelper.CreateParameter("@年度", obj.年度);
            DbParameter para2 = _daoHelper.CreateParameter("@売上", obj.売上_1);
            DbParameter para3 = _daoHelper.CreateParameter("@営業損益", obj.営業損益_1);
            DbParameter para4 = _daoHelper.CreateParameter("@経営損益", obj.経営損益_1);
            DbParameter para5 = _daoHelper.CreateParameter("@当期損益", obj.当期損益_1);
            DbParameter para6 = _daoHelper.CreateParameter("@常勤事務男", obj.常勤事務男);
            DbParameter para7 = _daoHelper.CreateParameter("@常勤事務女", obj.常勤事務女);
            DbParameter para8 = _daoHelper.CreateParameter("@常勤現場男", obj.常勤現場男);
            DbParameter para9 = _daoHelper.CreateParameter("@常勤現場女", obj.常勤現場女);
            DbParameter para10 = _daoHelper.CreateParameter("@非常勤現場女", obj.非常勤現場女);
            DbParameter para11 = _daoHelper.CreateParameter("@非常勤事務男", obj.非常勤事務男);
            DbParameter para12 = _daoHelper.CreateParameter("@企業ID", id企業ID);
            DbParameter para13 = _daoHelper.CreateParameter("@決算月", str決算月);
            DbParameter para14 = _daoHelper.CreateParameter("@IdCurrent", 0);
            para14.Direction = ParameterDirection.Output;
            com.Parameters.Add(para1);
            com.Parameters.Add(para2);
            com.Parameters.Add(para3);
            com.Parameters.Add(para4);
            com.Parameters.Add(para5);
            com.Parameters.Add(para6);
            com.Parameters.Add(para7);
            com.Parameters.Add(para8);
            com.Parameters.Add(para9);
            com.Parameters.Add(para10);
            com.Parameters.Add(para11);
            com.Parameters.Add(para12);
            com.Parameters.Add(para13);
            com.Parameters.Add(para14);
            i = _daoHelper.Execute(com);
            if (i != 0 && i != -1)
                IdCurrent = Int32.Parse(com.Parameters["@IdCurrent"].Value.ToString());

            return i;

        }

        public int insert_本社履歴_60_Default_Vh(本社履歴 obj, string id企業ID, string str決算月)
        {
             int i = 0;
             DbCommand com = _daoHelper.CreateCommand(CommandNameManager.insert_本社履歴_60_2_Default_Vh, CommandType.StoredProcedure);
             DbParameter para1 = _daoHelper.CreateParameter("@年度", obj.年度);
             DbParameter para2 = _daoHelper.CreateParameter("@売上", obj.売上);
             DbParameter para3 = _daoHelper.CreateParameter("@営業損益", obj.営業損益);
             DbParameter para4 = _daoHelper.CreateParameter("@経営損益", obj.経営損益);
             DbParameter para5 = _daoHelper.CreateParameter("@当期損益", obj.当期損益);
             DbParameter para6 = _daoHelper.CreateParameter("@常勤事務男", obj.常勤事務男);
             DbParameter para7 = _daoHelper.CreateParameter("@常勤事務女", obj.常勤事務女);
             DbParameter para8 = _daoHelper.CreateParameter("@常勤現場男", obj.常勤現場男);
             DbParameter para9 = _daoHelper.CreateParameter("@常勤現場女", obj.常勤現場女);
             DbParameter para10 = _daoHelper.CreateParameter("@非常勤現場女", obj.非常勤現場女);
             DbParameter para11 = _daoHelper.CreateParameter("@非常勤事務男", obj.非常勤事務男);
             DbParameter para12 = _daoHelper.CreateParameter("@企業ID", id企業ID);
             DbParameter para13 = _daoHelper.CreateParameter("@決算月", str決算月);
             com.Parameters.Add(para1);
             com.Parameters.Add(para2);
             com.Parameters.Add(para3);
             com.Parameters.Add(para4);
             com.Parameters.Add(para5);
             com.Parameters.Add(para6);
             com.Parameters.Add(para7);
             com.Parameters.Add(para8);
             com.Parameters.Add(para9);
             com.Parameters.Add(para10);
             com.Parameters.Add(para11);
             com.Parameters.Add(para12);
             com.Parameters.Add(para13);
             i = _daoHelper.Execute(com);
             return i;

        }  
          
       

      

      

        public int frmJ_CompHistoryInput_Update(int 年度, string 決算月, decimal 売上, decimal 営業損益, decimal 経営損益, decimal 当期損益, int 常勤事務男, int 常勤事務女, int 常勤現場男, int 常勤現場女, int 非常勤現場女, int 非常勤事務男, int ID)
        {
            
            DbCommand com = _daoHelper.CreateCommand(CommandNameManager.frmJ_CompHistoryInput_Update, CommandType.StoredProcedure);
            DbParameter para1 = _daoHelper.CreateParameter("@年度", 年度, DbType.Int32);
            DbParameter para2 = _daoHelper.CreateParameter("@決算月", 決算月, DbType.String);
            DbParameter para3 = _daoHelper.CreateParameter("@売上", 売上, DbType.Decimal);
            DbParameter para4 = _daoHelper.CreateParameter("@営業損益", 営業損益, DbType.Decimal);
            DbParameter para5 = _daoHelper.CreateParameter("@経営損益", 経営損益, DbType.Decimal);
            DbParameter para6 = _daoHelper.CreateParameter("@当期損益", 当期損益, DbType.Decimal);
            DbParameter para7 = _daoHelper.CreateParameter("@常勤事務男", 常勤事務男, DbType.Int32);
            DbParameter para8 = _daoHelper.CreateParameter("@常勤事務女", 常勤事務女, DbType.Int32);
            DbParameter para9 = _daoHelper.CreateParameter("@常勤現場男", 常勤現場男, DbType.Int32);
            DbParameter para10 = _daoHelper.CreateParameter("@常勤現場女", 常勤現場女, DbType.Int32);
            DbParameter para11 = _daoHelper.CreateParameter("@非常勤現場女", 非常勤現場女, DbType.Int32);
            DbParameter para12 = _daoHelper.CreateParameter("@非常勤事務男", 非常勤事務男, DbType.Int32);
            DbParameter para13 = _daoHelper.CreateParameter("@ID", ID, DbType.Int32);
            

            com.Parameters.Add(para1);
            com.Parameters.Add(para2);
            com.Parameters.Add(para3);
            com.Parameters.Add(para4);
            com.Parameters.Add(para5);
            com.Parameters.Add(para6);
            com.Parameters.Add(para7);
            com.Parameters.Add(para8);
            com.Parameters.Add(para9);
            com.Parameters.Add(para10);
            com.Parameters.Add(para11);
            com.Parameters.Add(para12);
            com.Parameters.Add(para13);
            return _daoHelper.Execute(com);
        }

        /// <summary>
        /// Coder: Ha Van Hoat
        /// Function: check duplicate
        /// Date: 03.03.2012
        /// </summary>
        /// <param name="年度">Years</param>
        /// <param name="決算月">Months</param>
        /// <param name="企業ID">企業ID code</param>
        /// <returns>true: if it exists a duplicate</returns>
        public bool checkSameYearMonthCase1_JS60(int 年度, string 決算月, int 企業ID)
        {
            bool flag = false;//Default no duplicate
            
            DbParameter para1 = _daoHelper.CreateParameter("@年度",年度);
            DbParameter para2 = _daoHelper.CreateParameter("@決算月",決算月);
            DbParameter para3 = _daoHelper.CreateParameter("@企業ID",企業ID);

            DbCommand com = _daoHelper.CreateCommand("checkSameYearMonthCase1_JS60_Vh", CommandType.StoredProcedure, para1, para2, para3);
            DataTable dt = _daoHelper.Query(com);
            
            if (dt.Rows.Count > 0)
                flag = true;

            return flag;
        }

        /// <summary>
        /// Coder: Ha Van Hoat
        /// Fuction: check duplicate
        /// Date: 03.03.2012
        /// </summary>
        /// <param name="年度"> Years</param>
        /// <param name="決算月">Months</param>
        /// <param name="idCurrent">ID</param>
        /// <returns>true: if it exists a duplicate</returns>
        public bool checkSameYearMonthCase2_JS60(int 年度, string 決算月, int idCurrent)
        {
            bool flag = false;//Default no duplicate

            DbParameter para1 = _daoHelper.CreateParameter("@年度", 年度);
            DbParameter para2 = _daoHelper.CreateParameter("@決算月", 決算月);
            DbParameter para3 = _daoHelper.CreateParameter("@ID", idCurrent);

            DbCommand com = _daoHelper.CreateCommand("checkSameYearMonthCase2_JS60_Vh", CommandType.StoredProcedure, para1, para2, para3);
            DataTable dt = _daoHelper.Query(com);

            if (dt.Rows.Count > 0)
                flag = true;

            return flag;
        }

      
        #endregion

        #region Thanh Dong
        public DataTable frmO_HistoryInfoInput_Select_本社履歴(int 企業ID)
        {
            DbParameter dbparam = _daoHelper.CreateParameter("@企業ID", 企業ID, DbType.Int32);
            DbCommand dbcomman = _daoHelper.CreateCommand(CommandNameManager.sp_frmO_HistoryInfoInput_Select_本社履歴_Dong, CommandType.StoredProcedure, dbparam);
            return _daoHelper.Query(dbcomman);
        }

        public int frmO_HistoryInfoInput_Insert_本社履歴(本社履歴 _本社履歴)
        {
            DbParameter dbparam1 = _daoHelper.CreateParameter("@年度", _本社履歴.年度, DbType.Int32);
            DbParameter dbparam2 = _daoHelper.CreateParameter("@決算月", _本社履歴.決算月, DbType.String);
            DbParameter dbparam3 = _daoHelper.CreateParameter("@常勤事務男", _本社履歴.常勤事務男, DbType.Int32);
            DbParameter dbparam4 = _daoHelper.CreateParameter("@常勤事務女", _本社履歴.常勤事務女, DbType.Int32);
            DbParameter dbparam5 = _daoHelper.CreateParameter("@常勤現場男", _本社履歴.常勤現場男, DbType.Int32);
            DbParameter dbparam6 = _daoHelper.CreateParameter("@常勤現場女", _本社履歴.常勤現場女, DbType.Int32);
            DbParameter dbparam7 = _daoHelper.CreateParameter("@従事者数男", _本社履歴.従事者数男, DbType.Int32);
            DbParameter dbparam8 = _daoHelper.CreateParameter("@従事者数女", _本社履歴.従事者数女, DbType.Int32);
            DbParameter dbparam9 = _daoHelper.CreateParameter("@加入している組合員数", _本社履歴.加入している組合員数, DbType.Int32);
            DbParameter dbparam10 = _daoHelper.CreateParameter("@企業ID", _本社履歴.企業ID, DbType.Int32);
            DbParameter dbparam11 = _daoHelper.CreateParameter("@廃止区分", _本社履歴.廃止区分, DbType.Int32);

            DbCommand dbcomman = _daoHelper.CreateCommand(CommandNameManager.sp_frmO_HistoryInfoInput_Insert_本社履歴_Dong, CommandType.StoredProcedure, dbparam1, dbparam2, dbparam3, dbparam4, dbparam5, dbparam6, dbparam7, dbparam8, dbparam9, dbparam10, dbparam11);
            return _daoHelper.Execute(dbcomman);
        }

        public int frmO_HistoryInfoInput_update_本社履歴(本社履歴 _本社履歴)
        {
            DbParameter dbparam0 = _daoHelper.CreateParameter("@ID", _本社履歴.ID, DbType.Int32);
            DbParameter dbparam1 = _daoHelper.CreateParameter("@年度", _本社履歴.年度, DbType.Int32);
            DbParameter dbparam2 = _daoHelper.CreateParameter("@決算月", _本社履歴.決算月, DbType.String);
            DbParameter dbparam3 = _daoHelper.CreateParameter("@常勤事務男", _本社履歴.常勤事務男, DbType.Int32);
            DbParameter dbparam4 = _daoHelper.CreateParameter("@常勤事務女", _本社履歴.常勤事務女, DbType.Int32);
            DbParameter dbparam5 = _daoHelper.CreateParameter("@常勤現場男", _本社履歴.常勤現場男, DbType.Int32);
            DbParameter dbparam6 = _daoHelper.CreateParameter("@常勤現場女", _本社履歴.常勤現場女, DbType.Int32);
            DbParameter dbparam7 = _daoHelper.CreateParameter("@従事者数男", _本社履歴.従事者数男, DbType.Int32);
            DbParameter dbparam8 = _daoHelper.CreateParameter("@従事者数女", _本社履歴.従事者数女, DbType.Int32);
            DbParameter dbparam9 = _daoHelper.CreateParameter("@加入している組合員数", _本社履歴.加入している組合員数, DbType.Int32);

            DbCommand dbcomman = _daoHelper.CreateCommand(CommandNameManager.sp_frmO_HistoryInfoInput_update_本社履歴_Dong, CommandType.StoredProcedure, dbparam0, dbparam1, dbparam2, dbparam3, dbparam4, dbparam5, dbparam6, dbparam7, dbparam8, dbparam9);
            return _daoHelper.Execute(dbcomman);
        }

        public DataTable frmO_HistoryInfoInput_Select_本社履歴_ByID(int ID)
        {
            DbParameter dbparam = _daoHelper.CreateParameter("@ID", ID, DbType.Int32);
            DbCommand dbcomman = _daoHelper.CreateCommand(CommandNameManager.sp_frmO_HistoryInfoInput_Select_本社履歴_ByID_Dong, CommandType.StoredProcedure, dbparam);
            return _daoHelper.Query(dbcomman);
        }



        public DataTable frmO_HistoryInfoInput_GetID(int 企業ID, int 年度, int 決算月)
        { 
            DbParameter dbparma1  = _daoHelper.CreateParameter("@企業ID", 企業ID, DbType.Int32);
            DbParameter dbparma2 = _daoHelper.CreateParameter("@年度", 年度, DbType.Int32);
            DbParameter dbparma3 = _daoHelper.CreateParameter("@決算月", 決算月, DbType.Int32);
            DbCommand dbcommand = _daoHelper.CreateCommand(CommandNameManager.sp_frmO_HistoryInfoInput_GetID_Dong, CommandType.StoredProcedure, dbparma1, dbparma2, dbparma3);
            return _daoHelper.Query(dbcommand);
        }

        public DataTable frmO_HistoryInfoInput_CheckExists_企業ID_Year(int 企業ID, int 年度)
        {
            DbParameter dbparma1 = _daoHelper.CreateParameter("@企業ID", 企業ID, DbType.Int32);
            DbParameter dbparma2 = _daoHelper.CreateParameter("@年度", 年度, DbType.Int32);
            DbCommand dbcommand = _daoHelper.CreateCommand("sp_frmO_HistoryInfoInput_CheckExists_企業ID_Year_Dong", CommandType.StoredProcedure, dbparma1, dbparma2);
            return _daoHelper.Query(dbcommand);
        }

        public DataTable frmJ_CompHistoryInput_Select本社履歴With企業ID年度(int 企業ID, int 年度)
        {
            DbParameter dbparma1 = _daoHelper.CreateParameter("@企業ID", 企業ID, DbType.Int32);
            DbParameter dbparma2 = _daoHelper.CreateParameter("@年度", 年度, DbType.Int32);
            DbCommand dbcommand = _daoHelper.CreateCommand(CommandNameManager.sp_frmJ_CompHistoryInput_Select本社履歴With企業ID年度_Dong, CommandType.StoredProcedure, dbparma1, dbparma2);
            return _daoHelper.Query(dbcommand);
        }

        

        #endregion
    }
}
